
package com.be.beadmin.product.service;

import com.be.beadmin.basicData.dto.output.UserEx;
import com.be.beadmin.common.entity.PageEntity;
import com.be.beadmin.product.dto.input.UserWorkHourInfoDto;
import com.be.beadmin.product.dto.output.UserWorkHourInfoEx;
import com.be.beadmin.product.entity.ProductManufactInfor;
import com.be.beadmin.product.entity.UserWorkHourInfo;
import org.springframework.data.domain.Page;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;

/**
* @description 服务接口
* @author zjm
* @date 2023-11-22
**/
public interface UserWorkHourInfoService {

    /**
    * 分页的查询接口
    * @param pageEntity
    * @return
    */
    Page<UserWorkHourInfoEx> getUserWorkHourInfoByPage(PageEntity pageEntity);

    /**
    * @param userWorkHourInfoDto
    */
    void addUserWorkHourInfo(UserWorkHourInfoDto userWorkHourInfoDto);

    /**
    * @param userWorkHourInfoDto
    */
    void updateUserWorkHourInfo(UserWorkHourInfoDto userWorkHourInfoDto);

    /**
    * @param id
    */
    void delUserWorkHourInfo(String id);

    /**
    * 删除多个角色
    * @param ids
    */
    void delUserWorkHourInfos (List<String> ids);

    /**
     * 获取当前用户的工序计时信息
     * @param request
     * @return
     */
    UserWorkHourInfo getUserWorkHourInfo(HttpServletRequest request, String processId);


    UserWorkHourInfo getUserWorkHourInfo(UserEx userEx, String processId);
    /**
     * 判断该工序是否开始了
     * @param productManufactInfor
     */
    int viewProcessState(ProductManufactInfor productManufactInfor);

    void startTiming(UserWorkHourInfo newUWHI);

    void finishTiming(UserWorkHourInfo userWorkHourInfo, Date findate);

    int viewProcessStateExceptSelf(ProductManufactInfor productManufactInfor, UserEx userEx);

    void pauseTiming(UserWorkHourInfo userWorkHourInfo);

}